import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

/**
 * CardTab - 安全组工作台配置
 * @date: 2019-11-28
 */
import React, { Component } from 'react';
import { Table } from 'antd';
import { yesOrNoRender } from 'utils/renderer';
import { tableScrollWidth } from 'utils/utils';
import intl from 'utils/intl';

var CardTab = /*#__PURE__*/function (_Component) {
  _inherits(CardTab, _Component);

  var _super = _createSuper(CardTab);

  function CardTab() {
    _classCallCheck(this, CardTab);

    return _super.apply(this, arguments);
  }

  _createClass(CardTab, [{
    key: "columns",
    get: function get() {
      return [{
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardCode').d('卡片代码'),
        dataIndex: 'code'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardName').d('卡片名称'),
        dataIndex: 'name'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardType').d('卡片类别'),
        dataIndex: 'catalogMeaning'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardH').d('高度'),
        dataIndex: 'h'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardW').d('长度'),
        dataIndex: 'w'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardX').d('位置X'),
        dataIndex: 'x'
      }, {
        title: intl.get('ciam.roleManagement.model.tenantAssignCards.cardY').d('位置Y'),
        dataIndex: 'y'
      }, {
        title: intl.get('ciam.securityGroup.model.securityGroup.defaultDisplayFlag').d('是否初始化'),
        dataIndex: 'defaultDisplayFlag',
        render: yesOrNoRender
      }, {
        title: intl.get('cpaas.common.explain').d('说明'),
        dataIndex: 'remark'
      }];
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          dataSource = _this$props.dataSource,
          loading = _this$props.loading,
          pagination = _this$props.pagination;
      var tableProps = {
        rowKey: 'id',
        columns: this.columns,
        bordered: true,
        dataSource: dataSource,
        loading: loading,
        pagination: pagination,
        scroll: {
          x: tableScrollWidth(this.columns, 700)
        }
      };
      return /*#__PURE__*/React.createElement(Table, tableProps);
    }
  }]);

  return CardTab;
}(Component);

export { CardTab as default };